package com.dingreading.cloud.mall.service;

import com.dingreading.cloud.common.base.R;
import com.dingreading.cloud.mall.dto.UpdateShopCartVo;
import com.dingreading.cloud.mall.entity.ShopCart;
import com.mybatisflex.core.service.IService;

import java.util.List;
import java.util.Map;

public interface ShopCartV5Service extends IService<ShopCart> {

    R<Object> myShopCarts(String storeUid, String staffUid);

    R<Object> deleteByIdIn(String storeUid, String staffUid, List<Long> ids);

    R<Object> editNum(String storeUid, String staffUid, String staffName, Long id, Integer num, Integer type);

    R<Object> addToShopCart(String storeUid, String staffUid, String staffName, Long goodsId, Long goodsTypeId, Integer num);

    R<Object> getShopCartInfo(String storeUid, String staffUid, Long couponStaffId, List<Long> shopCartIds);

    R<Object> nowNewShopCart(String storeUid, String staffUid, String staffName, Long goodsId, Long goodsTypeId, Integer num, String remark);

    R<Object> getCouponAndDeliveryAddress(String storeUid, String staffUid, List<Long> shopCartIds);

    R<Object> newOrder(String corpUid, String storeUid, String storeName, String staffUid, String staffName, List<Long> shopCartIds, Long deliveryId, Long couponStaffId, String remark);

    // 获取组合子购物车记录
    List<ShopCart> childListByStoreUidAndStaffUidAndUid(String storeUid, String staffUid, String mainShopCartUid);

    // // 获取员工购物车商品总数量
    long getStaffShopCartCountV3(String storeUid, String staffUid);

    // 根据购买记录和出库记录获取商品规格的待出库数量
    int getWaitSendNum(Long goodsTypeId);

    // 根据购买记录和出库记录获取商品规格的待出库数量集合
    Map<Long, Integer> getWaitSendNum(List<Long> goodsTypeIds);

    ShopCart getByStaffIdAndGoodsIdAndTypeId(String storeUid, String staffUid, Long goodsId, Long goodsTypeId, Integer mainComboType, Integer comboType);

    // 批量更新购物车商品的包邮状态
    void dbUpdateDeliveryStatus(List<UpdateShopCartVo> voList);

    void cancelShopCarts(String staffUid, String code);

    List<ShopCart> mainListAndChildListByCode(String code);

    List<ShopCart> mainListByCodeIn(List<String> codes);

    List<ShopCart> mainListByStaffUidAndCode(String staffUid, String code);

    List<ShopCart> childListByStoreUidAndStaffUidAndUidsAndCodeIsNull(String storeUid, String staffUid, List<String> mainShopCartUids);

    List<ShopCart> getByCode(String staffUid, String code);

    void setOk(String code, String payTimes);
}
